package com.dcivision.framework.taglib.channel;

import com.dcivision.alert.bean.UpdateAlert;

public class FilterUtility {

  public static String getSystemMsgObjectTypesAndActionTypes(String filterItem){
    StringBuffer objects = new StringBuffer();
    StringBuffer actionTypes = new StringBuffer();
    
    if(filterItem.equals(AjaxConstant.ALL))
    return null;
    if(filterItem.equals(AjaxConstant.MEETINGINVITATION)){
      objects.append("'").append(UpdateAlert.CALENDAR_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.CALENDAR_MODIFY_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.CALENDAR_INACTIVE_TYPE).append("'");
      actionTypes.append("'").append(UpdateAlert.INVITE_ACTION).append("'");
      return objects.append("|").append(actionTypes).toString();
    }
    if(filterItem.equals(AjaxConstant.MEETINGNOIFICATION)){
      objects.append("'").append(UpdateAlert.CALENDAR_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.CALENDAR_MODIFY_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.CALENDAR_INACTIVE_TYPE).append("'");
      actionTypes.append("!").append("'").append(UpdateAlert.INVITE_ACTION).append("'");
      return objects.append("|").append(actionTypes).toString();
    }
    if(filterItem.equals(AjaxConstant.DOCUMENTINVITATION)){
      objects.append("'").append(UpdateAlert.DOCUMENT_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.ISSUE_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.AUTOMATE_CHECKIN).append("'");
      actionTypes.append("'").append(UpdateAlert.INVITE_ACTION).append("'").append(", ");
      actionTypes.append("'").append(UpdateAlert.DISCUSS_ACTION).append("'");
      return objects.append("|").append(actionTypes).toString();
    }
    if(filterItem.equals(AjaxConstant.DOCUMENTNOTIFICATION)){
      objects.append("'").append(UpdateAlert.DOCUMENT_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.ISSUE_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.AUTOMATE_CHECKIN).append("'");
      actionTypes.append("!").append("'").append(UpdateAlert.INVITE_ACTION).append("'").append(", ");
      actionTypes.append("'").append(UpdateAlert.DISCUSS_ACTION).append("'");
      return objects.append("|").append(actionTypes).toString();
    }
    if(filterItem.equals(AjaxConstant.WORKFLOWNOTIFICATION)){
      objects.append("'").append(UpdateAlert.WORKFLOW_TYPE).append("'").append(", ");
      objects.append("'").append(UpdateAlert.DELEGATION_TYPE).append("'");
      return objects.toString();
    }
    if(filterItem.equals(AjaxConstant.EMAILRULENOTIFICATION)){
      objects.append("'").append(UpdateAlert.EMAIL_ARCHIVE_TYPE).append("'");
      return objects.toString();
    }
    return null;
  }
}
